package com.example.ssm.动态代理.two;

import com.example.ssm.entity.Student;
import com.example.ssm.mapper.StudentDao;

public class Main {

    public static void main(String[] args) {
        // 保留生成的字节码文件
        System.getProperties().setProperty("sun.misc.ProxyGenerator.saveGeneratedFiles","true");

        MyProxy myProxy = new MyProxy();

        //生成的代理类字节码文件会存放在工程目录下的com（sun.proxy）包下，与src同级
        StudentDao studentDao = myProxy.newInstance(StudentDao.class);

        Student student = studentDao.selectByPrimaryKey("12345");

        System.out.println(student);

    }

}
